home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / GLX / texvol / globals_vol.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  4.0 KB  |  158 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /*----------------------------------------------------------------------------
  18.  *
  19.  * file   : globals_vol.h
  20.  *
  21.  * Author : Yusuf Attarwala
  22.  * Date   : Sep 93
  23.  *
  24.  *---------------------------------------------------------------------------*/
  25. #include <stdio.h>
  26. #include <X11/Intrinsic.h>
  27. #include <Xm/Xm.h>
  28. #include <gl.h>
  29.  
  30. #ifdef DEFINE_VOL_GLOBALS
  31. #define VOL_GLOBAL
  32. #define VOL_INIT(x) = x
  33. #else
  34. #define VOL_GLOBAL extern
  35. #define VOL_INIT(x)
  36. #endif
  37.  
  38. #include "defines_vol.h"
  39.  
  40. VOL_GLOBAL Display        *display;
  41. VOL_GLOBAL long            screen;
  42. VOL_GLOBAL XtAppContext    appContext;
  43. VOL_GLOBAL XtTranslations  transTable;
  44. VOL_GLOBAL Widget          toplevel,
  45.                            glw;
  46. VOL_GLOBAL Widget          messageDialog,
  47.                    questionDialog,
  48.                    fileSelectionBox;
  49. VOL_GLOBAL Dimension       window_height,
  50.                            window_width;
  51.  
  52. VOL_GLOBAL int    width,height,depth;    /* size of volume */
  53.  
  54. VOL_GLOBAL float  bminx,bmaxx,           /* bounding box in world coords */
  55.                   bminy,bmaxy,
  56.                   bminz,bmaxz,
  57.           bdiag;
  58.  
  59. VOL_GLOBAL long   wminx,wmaxx,           /* window size */
  60.                   wminy,wmaxy;
  61.  
  62. VOL_GLOBAL float xy_v0[3],
  63.              xy_v1[3],
  64.              xy_v2[3],
  65.              xy_v3[3];
  66. VOL_GLOBAL float yz_v0[3],
  67.              yz_v1[3],
  68.              yz_v2[3],
  69.              yz_v3[3];
  70. VOL_GLOBAL float zx_v0[3],
  71.              zx_v1[3],
  72.              zx_v2[3],
  73.              zx_v3[3];
  74.  
  75. VOL_GLOBAL float  left,right,            /* projection parameters */
  76.                   bottom,top,
  77.                   near,far,              
  78.           reset_left,
  79.           reset_right,
  80.           reset_bottom,
  81.           reset_top,
  82.           reset_near,
  83.           reset_far;
  84.  
  85. VOL_GLOBAL float  x_world_per_pixel,
  86.           y_world_per_pixel,
  87.           world_aspect,
  88.           rotn_sens;
  89.  
  90. VOL_GLOBAL float  azimuth,               /* viewing parameters */
  91.                   incidence,
  92.                   twist,
  93.                   distance,
  94.           reset_azimuth,
  95.           reset_incidence,
  96.           reset_twist,
  97.           reset_distance;
  98.  
  99. VOL_GLOBAL Angle  anglex,
  100.           angley,
  101.           anglez,
  102.           reset_anglex,
  103.           reset_angley,
  104.           reset_anglez;
  105.  
  106. VOL_GLOBAL Matrix vmat,
  107.           mmat,
  108.           reset_vmat,
  109.           reset_mmat;
  110.  
  111. static Matrix identity = {1.0,0.0,0.0,0.0,
  112.                           0.0,1.0,0.0,0.0,
  113.                           0.0,0.0,1.0,0.0,
  114.                           0.0,0.0,0.0,1.0};
  115.  
  116. VOL_GLOBAL unsigned long cpackValue;
  117. VOL_GLOBAL unsigned char cpackAlpha,
  118.              cpackRed,cpackBlue,cpackGreen;
  119.  
  120. typedef struct {
  121.     int  onOff;
  122.     float coeff[4];
  123.     float xyz[3];
  124.     float min,max;
  125. }Clip;
  126.  
  127. VOL_GLOBAL Clip   clip[6];
  128. VOL_GLOBAL int    activeClipPlane;
  129.  
  130. VOL_GLOBAL float  fogParams[5];
  131. VOL_GLOBAL float  fogRGB[3];
  132. VOL_GLOBAL float  fogDensity,startFog,endFog;
  133. VOL_GLOBAL int    lightWeightCount;
  134.  
  135. VOL_GLOBAL int    degenMode,             /* bunch of state flags */
  136.                   drawAxis,
  137.                   doClipping,
  138.           displayClipPlanes,
  139.                   drawBoundingBox,
  140.                   doLighting,
  141.           screenAxes,
  142.           refresh,
  143.           trackBall,
  144.           doubleBuffer,
  145.                   lightWeight,
  146.           drawMode,
  147.           dontBlend,
  148.                   lockAView,
  149.                   moveSlice,
  150.                   obliquePlane,
  151.           fog,
  152.           fogMode,
  153.           textureMode;
  154.  
  155. /* these should be on the last lines */
  156. #undef VOL_INIT
  157. #undef VOL_GLOBAL
  158.